<?php

class m141005_131945_tbl_products extends CDbMigration
{
	public function up()
	{
		$this->createTable('tbl_products', array(
            'id' => 'pk',
            'pku' => 'string NOT NULL',
            'slug' => 'string NOT NULL',
            'name' => 'string',
            'content' => 'text',
            'image' => 'string',
            'cat_id' => 'int NOT NULL',
            'price' => 'int NOT NULL',
            'sale' => 'int',
            'sale_start' => 'datetime',
            'sale_end' => 'datetime',
            'new' => 'int',
            'created_by' => 'int',
            'created_at' => 'datetime',
            'status' => 'int default 0',
            'visits' => 'int default 0',
        ));
	}

	public function down()
	{
		$this->dropTable('tbl_products');
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}